<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>微软官方授权经销商</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <script src="__PUBLIC__/Weixin/js/jquery-3.3.1.min.js?version={$version}"></script>
    <script src="__PUBLIC__/Weixin/js/jquery.cookie.js?version={$version}"></script>
    <script src="__PUBLIC__/Weixin/js/function.js?version={$version}"></script>
    <script src="__PUBLIC__/Weixin/js/login.js?version={$version}"></script>
    <link rel="stylesheet" href="__PUBLIC__/Weixin/css/weui.css?version={$version}">
    <link rel="stylesheet" href="__PUBLIC__/Weixin/css/jquery-weui.css?version={$version}">
    <link rel="stylesheet" href="__PUBLIC__/Weixin/css/style.css?version={$version}">
    <script src="https://res2.wx.qq.com/open/js/jweixin-1.4.0.js?version={$version}"></script>
    <style>
        .wx_header {
            width:100%;
        }
      /*  .wx_cen {
            margin:22px 10px;
            height:38px;
            line-height: 1;
        }*/
        .wx_cen {
            background: url("/Public/office/images/split_product_1.png") no-repeat center center;
            background-size: 100%;
            height:81px;
        }

        .wx_cen2 {
            background: url("/Public/office/images/split_product_2.png") no-repeat center center;
            background-size: 100%;
            height:81px;
        }

        .wx_cen3 {
            background: url("/Public/office/images/split_product_3.png") no-repeat center center;
            background-size: 100%;
            height:81px;
        }

        .wx_cen4 {
            background: url("/Public/office/images/split_product_4.png") no-repeat center center;
            background-size: 100%;
            height:81px;
        }

        .wx_price {
            padding-top:3px;
        }
        .wx_money {
            font-size: 20px;
            font-weight: bold;
            color:#d83b01;
        }
        .wx_cen_left {
            float:left;
            line-height: 40px;
        }
        .wx_cen .wx_cen_left p {
            line-height: 20px;
        }

        .wx_cen_right {
            float: right;
            padding:12px 0px;
        }
        .wx-border {
            border-bottom:1px solid #cecece;
        }
        .wx_fh {
            color:#d83b01;
            font-weight: bold;
        }
        .wx_desc {
            padding-left: 6px;
            font-size:12px;
            vertical-align: text-top;
        }
        .wx_tips {
            margin:15px 10px;
        }
        .wx_icons {
            width: 126px;
            height: 43px;
            float: right;
            padding-right: 48px;
        }

        .wx_width_pic {
            max-width: 100%;
        }
        .wx_t {
            float:left;
        }

        .wx_date {
            font-size: 16px;
            padding-left: 3px;
        }
        .wx_year{
            margin-left: 6px;
        }

        .btn {
            background: #d83b01;
            width:75px;
            height:27px;
            line-height:27px;
            display: inline-block;
            text-align: center;
            color:#fff;
            font-size:14px;
            margin-top: 13px;
            margin-right: 15px;
        }
        .wx_view {
            font-size: 16px;
            color:#333;
        }

        .wx_two_view {
            font-size: 13px;
            color:#333;
            margin-top: 14px;
            line-height: 16px;
        }

        .wx_three_view {
            font-size: 13px;
            margin-top: 14px;
            line-height: 16px;
        }

        .wx_point {
            display: inline-block;
            background: #d83b01;
            width:3px;
            height:3px;
            margin: 3px 3px;
        }
        .hot{
            position: absolute;
            background: url("/Public/office/images/label1.png") no-repeat center center;
            background-size: 100%;
            width: 47px;
            height: 27px;
            right: 210px;
            top: 380px;
        }

        .hot2 {
            position: absolute;
            background: url("/Public/office/images/label2.png") no-repeat center center;
            background-size: 100%;
            width: 47px;
            height: 27px;
            right: 210px;
            top: 463px;
        }

        .hot3 {
            position: absolute;
            background: url("/Public/office/images/label3.png") no-repeat center center;
            background-size: 100%;
            width: 47px;
            height: 27px;
            right: 214px;
            top: 550px;
        }
        /*background----------------------------*/
     /*   .weui-background {
            background: #fff5ed;
            width:100%;
            height:165px;
        }
        */
        .weui-background img {
            width:100%;
        }
        .weui-media-box .weui-media-box__desc{
            margin-bottom:8px;
            color:#666;
            font-size:12px;
        }

        .icon-1{
            background:url("__PUBLIC__/office/images/icon_yh.png")no-repeat center center;
            background-size:100%;
        }

        .icon-2{
            background:url("__PUBLIC__/office/images/icon_ycc.png")no-repeat center center;
            background-size:100%;
        }
        .icon-3{
            background:url("__PUBLIC__/office/images/icon_pad.png")no-repeat center center;
            background-size:100%;
        }
        .icon-4{
            background:url("__PUBLIC__/office/images/icon_pad.png")no-repeat center center;
            background-size:100%;
        }
        .icon-5{
            background:url("__PUBLIC__/office/images/icon_bt.png")no-repeat center center;
            background-size:100%;
        }

        .icons{
            display: inline-block;
            width:16px !important;
            height:32px !important;
            vertical-align: bottom;
            margin-right:-6px;
        }

        .weui-media-box__desc{
            padding:0 8px;
            line-height: 1.2;
        }

        .weui-num {
            color: #de2c2c;
            font-weight: bold;
        }

        .weui-pic-all {
            margin-bottom: 1px !important;
        }

        .btn-img {
            width:140px;
            height:15px;
        }

        .weui-line-hei {
            #line-height: 1px;
        }

        .weui-flex{
            height:20px;
            padding:4px 0px;
        }
        .weui-flex__item {
            margin-top: 10px;
        }
        .weui-flex2{
            margin-bottom: 15px;
        }
        /*.js_shows{*/
           /*padding-top:10px;*/
        /*}*/

        /*background----------------------------*/

        /*footer--------------------------------*/
        .footer{
            text-align: center;
            margin-top:30px;
            margin-bottom:10px;
        }

        .footer h4{
            padding-bottom:2px;
            font-size:20px;
            font-weight: 500;
        }
        .footer span{
            color:#333;
            display: inline;
            padding-top:2px;
            font-size:14px;
            border-top: 1px solid #d9d9d9;
        }
        .footer img {
            width:148px;
            display: inline-block;
            margin-top:14px;
        }
        .ff{
            height:20px;
        }
        /*footer-------------------------------*/

        /*兼容模式*/
        @media only screen and (max-width:375px){
            .hot{
                position: absolute;
                background: url("/Public/office/images/label1.png") no-repeat center center;
                background-size: 100%;
                width: 47px;
                height: 27px;
                right: 170px;
                top: 360px;
            }

            .hot2 {
                position: absolute;
                background: url("/Public/office/images/label2.png") no-repeat center center;
                background-size: 100%;
                width: 47px;
                height: 27px;
                right: 170px;
                top: 444px;
            }

            .hot3 {
                position: absolute;
                background: url("/Public/office/images/label3.png") no-repeat center center;
                background-size: 100%;
                width: 47px;
                height: 27px;
                right: 178px;
                top: 526px;
            }
            .js_shows{
                padding-top:0;
            }

            .wx_date {
                font-size: 16px;
                padding-left: 5px;
            }

            .wx_price {
                padding-left: 2px;
            }
        }


        @media only screen and (max-width:414px) {
            .js_shows{
               padding-top:10px;
               padding-left: 7px;
            }

            .wx_cen {
                background: url("/Public/office/images/split_product_1.png") no-repeat center center;
                background-size: 100%;
                height:90px;
            }

            .wx_cen2 {
                background: url("/Public/office/images/split_product_2.png") no-repeat center center;
                background-size: 100%;
                height:90px;
            }

            .wx_cen3 {
                background: url("/Public/office/images/split_product_3.png") no-repeat center center;
                background-size: 100%;
                height:90px;
            }

            .wx_cen4 {
                background: url("/Public/office/images/split_product_4.png") no-repeat center center;
                background-size: 100%;
                height:90px;
            }
        }
        /*兼容模式完成*/
    </style>
    <script>
        wx.config({
            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
            appId: "{$id}", // 必填，公众号的唯一标识
            timestamp: "{$date}", // 必填，生成签名的时间戳
            nonceStr: "{$str}", // 必填，生成签名的随机串
            signature: "{$signature}",// 必填，签名
            jsApiList: [
                "onMenuShareAppMessage",
                "onMenuShareTimeline"
            ] // 必填，需要使用的JS接口列表
        });

        var url = "http://"+window.location.host+window.location.pathname+"?c_code={$c_code}";

        wx.ready(function () {   //需在用户可能点击分享按钮前就先调用
            wx.onMenuShareAppMessage({ //分享给朋友
                title: '每人每天低至0.23元的Office重磅升级', // 分享标题
                desc: '8款熟悉的应用，为忙到飞起的你简化操作，办公更高效！Skr！Skr！', // 分享描述
                link: url, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                imgUrl: 'http://cdn.office.store.zhuazi.com/pic/wechat/share/share_pic.png', // 分享图标
                type: '', // 分享类型,music、video或link，不填默认为link
                dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
                success: function () {
                    // 用户点击了分享后执行的回调函数
                }
            });
            wx.onMenuShareTimeline({
                title: '每人每天低至0.23元的Office重磅升级', // 分享标题
                link: url, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                imgUrl: 'http://cdn.office.store.zhuazi.com/pic/wechat/share/share_pic.png', // 分享图标
                success: function () {
                    // 用户点击了分享后执行的回调函数
                }
            });
        });
    </script>
</head>
<body>
    <div class="wx_header">
        <img class="wx_width_pic" src="__PUBLIC__/office/images/icons.png">
    </div>
   <div class="weui-background">
       <img src="__PUBLIC__/office/images/split_pic1.png">
       <!--     <div class="page flex js_show js_shows">
               <div class="page__bd page__bd_spacing">
                   <div class="weui-flex">
                       <div class="placeholder"><p class="weui-media-box__desc"><span class="icon-1 icons"></span></div>
                       <div class="weui-flex__item"><div class="placeholder"><p class="weui-media-box__desc">1人使用</p></div></div>
                   </div>
                   <div class="weui-flex">
                       <div class="placeholder"><p class="weui-media-box__desc"><span class="icon-2 icons"></span></div>
                       <div class="weui-flex__item"><div class="placeholder"><p class="weui-media-box__desc">送价值<span class="weui-num">￥480</span>/年的云存储空间 (1TB)</p></div></div>
                   </div>
                   <div class="weui-flex weui-flex2">
                     <div class="placeholder"><p class="weui-media-box__desc"><span class="icon-5 icons"></span></div>
                       <div class="weui-flex__item">
                           <div class="placeholder">
                               <p class="weui-media-box__desc weui-pic-all">包含7款应用</p>
                               <p class="weui-media-box__desc" style="letter-spacing:0.1px"><img class="btn-img" src="__PUBLIC__/office/images/icon_pro2.png"></p>
                           </div>
                       </div>
                   </div>
                   <div class="weui-flex weui-flex2">
                       <div class="placeholder"><p class="weui-media-box__desc"><span class="icon-4 icons"></span></div>
                       <div class="weui-flex__item"><div class="placeholder"><p class="weui-media-box__desc weui-line-hei">可在多台电脑/Mac、平板电脑和手机上使用(包括 Windows、iOS和Android)</p></div></div>
                   </div>
               </div>
           </div> -->
       </div>
   <!-- <div class="wx_cen">
        <div class="wx_cen_left">
            <p class="wx_price"><span class="wx_fh">￥</span><span class="wx_money">168</span></p>
            <p class="wx_date"><span class="wx_mon">12个月</span> <span class="wx_year">(1年)</span></p>
        </div>
        <div class="wx_cen_right">
            <a href="javascript:;" data="1274c85c9791c16dca2ff87dd927317e" class="btn subscribe">购买</a>
        </div>
    </div>
    <div class="wx-border"></div>
    <div class="wx_cen">
        <div class="wx_cen_left">
            <p class="wx_price"><span class="wx_fh">￥</span><span class="wx_money">298</span><span class="wx_desc">相当于<span class="wx_fh">￥149/年</span></span><span class="hot"></span></p>
            <p class="wx_date"><span class="wx_mon">24个月</span> <span class="wx_year">(2年)</span></p>
        </div>
        <div class="wx_cen_right">
            <a href="javascript:;" data="c5bed2c04adde29ae2eb3ae08b5c4e6e" class="btn subscribe">购买</a>
        </div>
    </div>
    <div class="wx-border"></div>
    <div class="wx_cen">
        <div class="wx_cen_left">
            <p class="wx_price"><span class="wx_fh">￥</span><span class="wx_money">398</span><span class="wx_desc">相当于<span class="wx_fh">￥132/年</span></span><span class="hot2"></span></p>
            <p class="wx_date"><span class="wx_mon">36个月</span> <span class="wx_year">(3年)</span></p>
        </div>
        <div class="wx_cen_right">
            <a href="javascript:;" data="c96283afa61ebaf7b5a8f549b799aa08" class="btn subscribe">购买</a>
        </div>
    </div>
    <div class="wx-border"></div>
    <div class="wx_cen">
        <div class="wx_cen_left">
            <p class="wx_price"><span class="wx_fh">￥</span><span class="wx_money">498</span><span class="wx_desc">相当于<span class="wx_fh">￥99/年</span></span><span class="hot3"></span></p>
            <p class="wx_date"><span class="wx_mon">60个月</span> <span class="wx_year">(5年)</span></p>
        </div>
        <div class="wx_cen_right">
            <a href="javascript:;" data="ef7b1dfe46033e396cf144248439f640" class="btn subscribe">购买</a>
        </div>
    </div>
    <div class="wx-border"></div> -->
    <div class="wx_cen"><div class="wx_cen_right"><a href="javascript:;" data="a7d2ea13c79882bad8de2e6bc2ae263d" class="btn subscribe">购买</a></div></div>
    <div class="wx_cen2"><div class="wx_cen_right"><a href="javascript:;" data="c5bed2c04adde29ae2eb3ae08b5c4e6e" class="btn subscribe">购买</a></div></div>
    <div class="wx_cen3"><div class="wx_cen_right"><a href="javascript:;" data="c96283afa61ebaf7b5a8f549b799aa08" class="btn subscribe">购买</a></div></div>
    <!--<div class="wx_cen4"><div class="wx_cen_right"><a href="javascript:;" data="ef7b1dfe46033e396cf144248439f640" class="btn subscribe">购买</a></div></div>-->


    <div class="wx_tips">
        <p class="wx_view">温馨提示:</p>
        <p class="wx_two_view"><span class="wx_point"></span>为了您可以准确收到产品的<span class="wx_fh ">激活链接</span>和及时解决安装问题, 请一定要保持关注我们的"办公技巧专家" 公众号哦~</p>
        <p class="wx_three_view"><span class="wx_point"></span>软件激活链接属于虚拟化数字产品, 一经售卖, 概不退换</p>
    </div>
    <div class="footer">
        <h4>办公技巧专家</h4>
        <p><span>体验新时代的办公方式</span></p>
        <img src="__PUBLIC__/office/images/pic_code.png">
    </div>
    <div class="ff">

    </div>
</body>
<script>
    var hj = "{$hj}"=="product"?true:false;
    var c_code = "{$c_code}";
    var buy_position = "{$buy_position}"

    if(hj){
        var _hmt = _hmt || [];
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?3f56b769ceb8f4b21bb181eae21c2097";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);

        _hmt.push(['_trackEvent','splitDetail','view',"拆分版页面访问"]);
        _hmt.push(['_trackEvent','splitDetail','view',buy_position+"_"+c_code]); //渠道
    }

    sendTagLog("inOfficeCore",true);


    var jsApiParameters = { };
    var order_token = '';
    var productList = {$productList};

    $(".subscribe").click(function(){
        var productToken = $(this).attr("data");
        if(hj){
            _hmt.push(['_trackEvent','splitDetail','click',productList[productToken]]);
        }

        $.ajax({
            type: "post",
            url: "/weixinapi/pay/qrcode",
            //url: "/api/index.php/weixinuser/openid",
            async:false, //同步
            data: {"token":webuser.data.token,"product_token":productToken,"buy_position":buy_position,"two_purchase":1,"channel":c_code,"openid":webuser.data.openid},
            dataType: "json",
            success: function(data){
                if(data.code == 200){
                    tt = data.data['_time']
                    // alert(data.data.order_token);
                    jsApiParameters = JSON.parse(data.data.jsApiParameters);
                    order_token = data.data.order_token;
                    //alert(1 + jsApiParameters.appId);
                    callpay();

                    //window.location.href = data.data.url+"?end=wechatWeb";
                }
            }
        });
    });

    //调用微信JS api 支付
    function jsApiCall()
    {
        //alert( 4 + "" + jsApiParameters.appId);

        WeixinJSBridge.invoke(
            'getBrandWCPayRequest',
            jsApiParameters,
            function(res){
//                WeixinJSBridge.log(res.err_msg);
                // alert(res.err_code+res.err_desc+res.err_msg+"   "+tt);
                //
                if(res.err_msg == "get_brand_wcpay_request:ok" ){
                    sleep(1500);
                    window.location.href="{:U('/Office/pay/wxwebmsg','status=success')}"+"?order_token="+order_token;
                }else if(res.err_msg == "get_brand_wcpay_request:cancel" ){
                    sendTagLog("inPaypageCancel",false);
                    //window.location.href="{:U('/Office/pay/wxmsg','status=cancel','html')}";
                    window.location.href="{:U('/weixin/product/splitDetail','','html')}"+"?c_code="+c_code+"&buy_position="+buy_position;
                }else if(res.err_msg == "get_brand_wcpay_request:fail" ){
                    sendTagLog("inPaypageCancel",false);
                    //window.location.href="{:U('/Office/pay/wxmsg','status=fail','html')}";
                    window.location.href="{:U('/weixin/product/splitDetail','','html')}"+"?c_code="+c_code+"&buy_position="+buy_position;
                }
            }
        );
    }

    function callpay()
    {
        //alert(2 + jsApiParameters.appId);

//        _hmt.push(['_trackEvent','pay_wechat','click',"确认支付按钮点击"]);
        if (typeof WeixinJSBridge == "undefined"){

            if( document.addEventListener ){
                document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
            }else if (document.attachEvent){
                document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
            }
        }else{

            jsApiCall();
        }
    }

    function sleep(numberMillis) {
        var now = new Date();
        var exitTime = now.getTime() + numberMillis;
        while (true) {
            now = new Date();
            if (now.getTime() > exitTime)
                return;
        }
    }

</script>
</html>